//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package net.mingsoft.basic.biz.impl;

import net.mingsoft.base.biz.impl.BaseBizImpl;
import net.mingsoft.base.dao.IBaseDao;
import net.mingsoft.basic.biz.ILogBiz;
import net.mingsoft.basic.dao.ILogDao;
import net.mingsoft.basic.entity.LogEntity;
import net.mingsoft.basic.util.IpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service("basiclogBizImpl")
public class LogBizImpl extends BaseBizImpl<ILogDao, LogEntity> implements ILogBiz {
    @Autowired
    private ILogDao logDao;

    public LogBizImpl() {
    }

    protected IBaseDao getDao() {
        return this.logDao;
    }

    @Async
    public void saveData(LogEntity logEntity) throws InterruptedException {
        String address = IpUtils.getRealAddressByIp(logEntity.getLogIp());
        logEntity.setLogLocation(address);
        this.save(logEntity);
    }
}
